<div class='page_title'>Disponibilités</div>
<?
foreach($data_classes as $id=>$data_classe){ ?>
	<div class='dispos_liste_classe'><div class='dispos_liste_classe_title dispos_liste_classe_<? echo $id; ?>'><? echo $data_classe[0]; ?></div>
	<table style="width: 100%;" cellpadding="0">
		<tr>
			<td>&nbsp;</td>
			<td colspan="7">
				<table style=" width: 100%;">
					<tr>
						<td style="width: 15px;"><? if($tso==$tsoa){ ?><img src="themes/Discovery/images/fleche_gauche2.gif" /><? }else{ ?><a href="<? echo CFG_REP_INSTALL."dispos"; ?>?tso=<? echo $tso-(7*24*3600); ?>#<? echo $id; ?>"><img src="themes/Discovery/images/fleche_gauche.gif" border="0" /></a><? } ?></td>
						<td style="text-align: center; font-size: 14px; font-weight: bold;">Semaine du Mercredi <? echo date("d/m",$tso); ?> au Mardi <? echo date("d/m",$tso+(6*24*3600)); ?></td>
						<td style="width: 15px;"><a href="<? echo CFG_REP_INSTALL."dispos"; ?>?tso=<? echo $tso+(7*24*3600); ?>#<? echo $id; ?>"><img src="../WGM/themes/Discovery/images/fleche_droite.gif" border="0" /></a></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<? for($i=0;$i<7;$i++){
				$m=date("m",$tso);
				$d=date("d",$tso);
				$y=date("y",$tso);
				$tso2=mktime(0,0,0,$m,$d+$i,$y); ?>
			<td style="font-size: 10px; text-align: center;"><? echo $jours[date("w",$tso2)]."<br />".date("d/m",$tso2); ?></td>
			<? } ?>
		</tr>
	<? $res=$sql->request("select * from ".CFG_MYSQL_PREFIX."player where classe=".$id." order by nom");
	$j=0;
	foreach($res as $var){
		$player=new player($var); ?>
		<tr <? if(($j%2)==0){ ?>class="tr2"<? } ?>>
			<td>
				<table cellspacing="1" cellpadding="0">
					<tr>
						<td style="width: 10px;"><img src="images/player/<? echo $player->get_race()."-".$player->get_sexe(); ?>.gif" alt="" /></td>
						<td style=""><a href="roster/player?id=<? echo $player->get_id(); ?>"><? echo $player->get_nom(); ?></a></td>
					</tr>
				</table>
			</td>
			<? for($i=0; $i<7; $i++){
				$m=date("m",$tso);
				$d=date("d",$tso);
				$y=date("y",$tso);
				$tso2=mktime(0,0,0,$m,$d+$i,$y);
				$dispo=get_dispo($tso2,$player->id);
				if($player->idUser==$GLOBALS["USER"]->id){ ?>
			<td style="width: 75px;">
				<select onchange='disposChangeDispo(this,<? echo $player->id; ?>, <? echo $tso2; ?>);' style='background-color: <? echo $cfg_params["liste_types"][$dispo][1]; ?>;'>
					<? foreach($cfg_params["liste_types"] as $type){ ?>
					<option style='background-color: <? echo $type[1]; ?>' value='<? echo $type[2]; ?>' <? if($dispo==$type[2]) echo "selected='selected'"; ?>><? echo $type[0]; ?></option>
					<? } ?>
				</select>
			</td>
				<? }else{ ?>
			<td style="width: 75px; background-color: <? echo $cfg_params["liste_types"][$dispo][1]; ?>;">&nbsp;</td>
				<? }
			}?>
		</tr>		
		<? $j++;
	}
	echo "</table></div>";
}

?>